<?php
/**
 * Wap路由模块
 */

Route::group(['namespace' => '\App\Module\Wap\Controllers','prefix' => 'wap'], function () {
   /* if(strstr(request()->server('REQUEST_URI'),'wap'))
    {
        echo "<span style='color: red;'>尊敬的创客用户，您好！<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由于“创享GO”新系统正在公测，为保护系统数据不受影响，暂时关闭创客手机版，对此给您造成的不便，敬请谅解，谢谢！</span>";
        die;
    }*/

    /**
     * 在 "\App\Module\Wap\Controllers" 命名空间下的控制器
     * 需要登录的和不需要登录的区分
     * 根据大模块设置路由组
     * 注意：路由在设置时，必须指定路由名，例如：'wap.index.index'--模块名.控制器名.方法名
     */

    //管理员登录
    Route::get('/index/login', 'IndexController@login')->name('wap.index.login');
    Route::post('/index/ajaxLogin', 'IndexController@ajaxLogin')->name('wap.index.ajaxLogin');
    //修改密码
    Route::any('/index/changePassword', 'IndexController@changePassword')->name('wap.index.changePassword');
    //修改手机号码
    Route::get('/index/updateMobile', 'IndexController@updateMobile')->name('wap.index.updateMobile');

    Route::group(['middleware' => ['CheckUserLogin']], function () {//中间件验证登陆
        Route::group([], function () {
            //帐号列表
            Route::get('/index', 'IndexController@index')->name('wap.index.index');
            //帐号详情
            Route::any('/index/detail/{id?}', 'IndexController@detail')->name('wap.index.detail');
            //提现
            Route::get('/index/withdraw/{id?}/{bankId?}', 'IndexController@withdraw')->name('wap.index.withdraw');
            Route::post('/index/ajaxWithdraw', 'IndexController@ajaxWithdraw')->name('wap.index.ajaxWithdraw');
            //业绩
            Route::get('/index/achievement/{id?}', 'IndexController@achievement')->name('wap.index.achievement');
            //用户
            Route::get('/index/refereeList/{id?}', 'IndexController@refereeList')->name('wap.index.refereeList');
            //转移帐号
            Route::any('/index/transferAccount/{id?}', 'IndexController@transferAccount')->name('wap.index.transferAccount');
            //银行卡列表
            Route::get('/index/bankAccountList/{id?}', 'IndexController@bankAccountList')->name('wap.index.bankAccountList');
            //绑定银行卡
            Route::any('/index/addBankAccount/{id?}', 'IndexController@addBankAccount')->name('wap.index.addBankAccount');
            //删除银行卡
            Route::post('/index/delBankAccount', 'IndexController@delBankAccount')->name('wap.index.delBankAccount');
        });
    });

});